<template>
    <PageHeader class="pageHeader" id="pageHeader">
        <view class="title">个人中心</view>
    </PageHeader>
    
    <view class="p-l-r m-t-20">
        <view style="display: flex;align-items: center;">
            <view class="avatar">
                <template v-if="avatar">
                    <NetImage class="pic" :src="avatar" />
                </template>
                <template v-else>
                    <view class="icon">
                        <Photograph style="color: #fff;" />
                    </view>
                </template>
            </view>
            <view class="m-l-30">李先生</view>
        </view>
    </view>

    <view class="p-l-r m-t-30">
        <view class="likeData">
            <navigator class="item">
                <view class="value">10</view>
                <view class="title">我关注的</view>
            </navigator>
            <navigator class="item">
                <view class="value">10</view>
                <view class="title">关注我的</view>
            </navigator>
            <navigator class="item">
                <view class="value">10</view>
                <view class="title">我看过的</view>
            </navigator>
            <navigator class="item">
                <view class="value">10</view>
                <view class="title">看过我的</view>
            </navigator>
        </view>
    </view>

    <view class="p-l-r">
        <!-- <view>相册</view>
        <view class="m-t-10">
            <Albums />
        </view> -->
    </view>

    <view class="p-l-r m-t-40">
        <Cell class="cell" is-link bordered url="/infoInputPages/personInfo/index">我的资料</Cell>
        <Cell class="cell" is-link>择偶要求</Cell>
        <Cell class="cell" is-link url="/infoInputPages/albums/index">相册</Cell>
        <!-- <view>个人资料</view>
        <view class="m-t-10">
            <BaseInfo />
        </view> -->
    </view>
</template>


<script lang="ts" setup>
    //import Albums from './Albums.vue';
    import BaseInfo from './BaseInfo.vue';
    import Cell from '@/components/Cell.vue'
    import { ref } from 'vue';
    import NetImage from '@/components/NetImage.vue'
    import { hideLoading, showLoading, showToast } from '@/utils/framework';
    import { uploadAvatarApi } from '@/api/User';
    import { Photograph } from '@nutui/icons-vue-taro';

    const avatar = ref('')


    async function confirmAvatar(e) {
        showLoading()
        const r = await uploadAvatarApi(e)
        hideLoading()
        if(r.success) {
            avatar.value = r.data
        }else {
            showToast('上传失败')
        }
    }
    
</script>

<style lang="scss" src="./index.scss"></style>